<template>
    <div class="edu-page-warp">
        <el-card shadow="never" body-style="padding: 24px;">
            <template v-if="isGraduate">
                <schemePreviewForGraduate :template-id="id" :data-type="dataType"/>
            </template>
            <template v-else>
                <schemePreview :template-id="id" :data-type="dataType"/>
            </template>
        </el-card>
    </div>
</template>

<script>
import templateBaseInfo from "./templateBaseInfo";
import courseCategoryForm from "./courseCategoryForm";
import courseForm from "./courseForm";
import schemePreview from "../culturescheme/schemePreview";
import schemeChapter from "../culturescheme/schemeChapter";

import templateBaseInfoForGraduate from "./graduate/templateBaseInfo";
import courseCategoryFormForGraduate from "./graduate/courseCategoryForm";
import schemePreviewForGraduate from "common/src/views/culture/culturescheme/graduate/schemePreview";
import schemeChapterForGraduate from "common/src/views/culture/culturescheme/graduate/schemeChapter";
import courseFormForGraduate from "./graduate/courseForm";

export default {
    name: "culture-template-detail",
    components: {
        templateBaseInfo,
        courseCategoryForm,
        courseForm,
        schemePreview,
        schemeChapter,
        courseFormForGraduate,
        templateBaseInfoForGraduate,
        courseCategoryFormForGraduate,
        schemePreviewForGraduate,
        schemeChapterForGraduate
    },
    data() {
        return {
            projId: "",
            id: null, // 新建模板为空，编辑模板时保存模板id
            isRead: false
        };
    },
    computed: {
        isGraduate() {
            // 如果是1代表是本科，其他是研究生
            return this.projId !== "1";
        }
    },
    created() {
        console.log(this.$route.params.projId)
        console.log(this.projId)
        this.projId = this.$route.params.projId;
        this.id = this.$route.params.id;
        this.templateId = this.$route.params.templateId;
        this.dataType = this.$route.params.dataType;
        this.isRead = this.$route.params.isRead;
    },
    methods: {}
};
</script>

<style lang="scss" scoped>
.sitemap {
    font-size: 12px;
    margin-bottom: 15px;
}
.edu-page-title {
    span {
        cursor: pointer;
        display: inline-block;
        padding-right: 10px;
    }
    span.active {
        color: #2876c2;
    }
}
.border-right {
    margin-right: 10px;
}
</style>
